Analysis date: 2023-02-03

Depends on

DIPG_FirstBatch_DataProcessing Script

load("../Data/Cache/Xenografts_Batch1_2_DataProcessing.RData")

TODO

  • Do differential abudance analysis for prep batch and mass spec run

Setup

Load libraries and functions

Analysis

DEP

Tyrosine all

Each condition vs ctrl

data_diff_ctrl_vs_E_pY <- test_diff(pY_se, type="manual", test = "E_vs_ctrl")
## Tested contrasts: E_vs_ctrl
dep_ctrl_vs_E_pY <- add_rejections_SH(data_diff_ctrl_vs_E_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_ctrl_vs_E_pY, contrast = "E_vs_ctrl", 
                label_size = 2, add_names = TRUE,
                additional_title = "pY") )
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Return_DEP_Hits_Plots(data = pY_noNA, dep_ctrl_vs_E_pY, comparison = "E_vs_ctrl_diff")
## Warning: Using an external vector in selections was deprecated in tidyselect 1.1.0.
## ℹ Please use `all_of()` or `any_of()` instead.
##   # Was:
##   data %>% select(comparison)
## 
##   # Now:
##   data %>% select(all_of(comparison))
## 
## See <https://tidyselect.r-lib.org/reference/faq-external-vector.html>.
## 'select()' returned 1:1 mapping between keys and columns
## Loading required namespace: reactome.db
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

##                                              pathway      pval      padj
## 1:                         ABC transporter disorders 0.9766082 0.9903782
## 2:            ABC-family proteins mediated transport 0.9766082 0.9903782
## 3:         ADP signalling through P2Y purinoceptor 1 0.3469786 0.9003641
## 4:                             ALK mutants bind TKIs 0.4113060 0.9003641
## 5: APC/C-mediated degradation of cell cycle proteins 0.4990215 0.9003641
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.3251534 0.9003641
##       log2err         ES        NES size leadingEdge
## 1: 0.04558782  0.5093168  0.6698577    1        5687
## 2: 0.04558782  0.5093168  0.6698577    1        5687
## 3: 0.09821234  0.8509317  1.1191525    1        1432
## 4: 0.08835944  0.8198758  1.0783075    1        1213
## 5: 0.07808923 -0.6702564 -1.0045051    2         983
## 6: 0.10512513 -0.8447205 -1.1264660    1         983
data_diff_EC_vs_ctrl_pY <- test_diff(pY_se, type="manual", test = "EC_vs_ctrl")
## Tested contrasts: EC_vs_ctrl
dep_EC_vs_ctrl_pY <- add_rejections_SH(data_diff_EC_vs_ctrl_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_EC_vs_ctrl_pY, contrast = "EC_vs_ctrl", 
                label_size = 2, add_names = TRUE,
                additional_title = "pY") )
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Return_DEP_Hits_Plots(data = pY_noNA, dep_EC_vs_ctrl_pY, comparison = "EC_vs_ctrl_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

##                                              pathway      pval      padj
## 1:                         ABC transporter disorders 0.8928571 0.9514509
## 2:            ABC-family proteins mediated transport 0.8928571 0.9514509
## 3:         ADP signalling through P2Y purinoceptor 1 0.2752101 0.7369183
## 4:                             ALK mutants bind TKIs 1.0000000 1.0000000
## 5: APC/C-mediated degradation of cell cycle proteins 0.7783172 0.9514509
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.3802281 0.8086806
##       log2err         ES        NES size leadingEdge
## 1: 0.05312981  0.5527950  0.7399919    1        5687
## 2: 0.05312981  0.5527950  0.7399919    1        5687
## 3: 0.11776579  0.8757764  1.1723468    1        1432
## 4: 0.04336370 -0.5031056 -0.6704875    1        1213
## 5: 0.04744832 -0.5292285 -0.8277662    2         983
## 6: 0.09139243 -0.8136646 -1.0843687    1         983
Plot_Enrichment_Single_Pathway(dep_EC_vs_ctrl_pY, comparison = "EC_vs_ctrl_diff", 
                               pw = "Epigenetic regulation of gene expression")
data_diff_EBC_vs_ctrl_pY <- test_diff(pY_se, type="manual", test = "EBC_vs_ctrl")
## Tested contrasts: EBC_vs_ctrl
dep_EBC_vs_ctrl_pY <- add_rejections_SH(data_diff_EBC_vs_ctrl_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_EBC_vs_ctrl_pY, contrast = "EBC_vs_ctrl", 
                label_size = 2, add_names = TRUE,
                additional_title = "pY"))
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Return_DEP_Hits_Plots(data = pY_noNA, dep_EBC_vs_ctrl_pY, comparison = "EBC_vs_ctrl_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

##                                              pathway      pval      padj
## 1:                         ABC transporter disorders 0.3151751 0.5351808
## 2:            ABC-family proteins mediated transport 0.3151751 0.5351808
## 3:         ADP signalling through P2Y purinoceptor 1 0.7334630 0.8929530
## 4:                             ALK mutants bind TKIs 0.7008197 0.8656095
## 5: APC/C-mediated degradation of cell cycle proteins 0.6565934 0.8386815
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.9649805 0.9805038
##       log2err         ES        NES size leadingEdge
## 1: 0.10395847  0.8571429  1.1230369    1        5687
## 2: 0.10395847  0.8571429  1.1230369    1        5687
## 3: 0.05871859  0.6583851  0.8626225    1        1432
## 4: 0.06335970 -0.6645963 -0.8825751    1        1213
## 5: 0.08152651  0.5312500  0.8614477    2        5687
## 6: 0.04604577  0.5279503  0.6917256    1         983

Not ctrl vs ctrl

data_diff_vs_ctrl_pY <- test_diff_to_all_other(pY_se, control = "ctrl")
dep_vs_ctrl_pY <- add_rejections_SH(data_diff_vs_ctrl_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_vs_ctrl_pY, contrast = "not_ctrl_vs_ctrl", label_size = 2, add_names = TRUE, additional_title = "pY") )
Return_DEP_Hits_Plots(data = pY_noNA, dep_vs_ctrl_pY, comparison = "not_ctrl_vs_ctrl_diff")

EC vs E

data_diff_EC_vs_E_pY <- test_diff(pY_se, type = "manual", 
                              test = c("EC_vs_E"))
## Tested contrasts: EC_vs_E
dep_EC_vs_E_pY <- add_rejections_SH(data_diff_EC_vs_E_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_EC_vs_E_pY, contrast = "EC_vs_E", label_size = 2, add_names = TRUE, additional_title = "pY"))
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Return_DEP_Hits_Plots(data = pY_noNA, dep_EC_vs_E_pY, comparison = "EC_vs_E_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

##                                              pathway      pval      padj
## 1:                         ABC transporter disorders 0.9818548 0.9935436
## 2:            ABC-family proteins mediated transport 0.9818548 0.9935436
## 3:         ADP signalling through P2Y purinoceptor 1 0.8951613 0.9935436
## 4:                             ALK mutants bind TKIs 0.7628458 0.9510145
## 5: APC/C-mediated degradation of cell cycle proteins 0.6895735 0.9081003
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.5080645 0.7877949
##       log2err         ES        NES size leadingEdge
## 1: 0.04688199  0.5155280  0.6881103    1        5687
## 2: 0.04688199  0.5155280  0.6881103    1        5687
## 3: 0.05111480  0.5527950  0.7378532    1        1432
## 4: 0.05760911 -0.6149068 -0.8181550    1        1213
## 5: 0.07130530  0.5187500  0.8275992    2         983
## 6: 0.07871138  0.7515528  1.0031487    1         983
#data_results <- get_df_long(dep)

EBC vs EC

data_diff_EC_vs_EBC_pY <- test_diff(pY_se, type = "manual", 
                              test = c("EC_vs_EBC"))
## Tested contrasts: EC_vs_EBC
dep_EC_vs_EBC_pY <- add_rejections_SH(data_diff_EC_vs_EBC_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_EC_vs_EBC_pY, contrast = "EC_vs_EBC", label_size = 2, add_names = TRUE, additional_title = "pY"))
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Return_DEP_Hits_Plots(data = pY_noNA, dep_EC_vs_EBC_pY, comparison = "EC_vs_EBC_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

##                                              pathway       pval      padj
## 1:                         ABC transporter disorders 0.17063492 0.4446525
## 2:            ABC-family proteins mediated transport 0.17063492 0.4446525
## 3:         ADP signalling through P2Y purinoceptor 1 0.67269076 0.7901688
## 4:                             ALK mutants bind TKIs 0.31927711 0.5359499
## 5: APC/C-mediated degradation of cell cycle proteins 0.03894189 0.3034222
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.25793651 0.4852412
##       log2err         ES        NES size leadingEdge
## 1: 0.14920754 -0.9192547 -1.2016982    1        5687
## 2: 0.14920754 -0.9192547 -1.2016982    1        5687
## 3: 0.06435834  0.6708075  0.8850999    1        1432
## 4: 0.10512513  0.8509317  1.1227656    1        1213
## 5: 0.32177592 -0.8937500 -1.4466064    2    5687,983
## 6: 0.11828753 -0.8881988 -1.1611003    1         983
#data_results <- get_df_long(dep)

Preps

pY_se_preps <- pY_se

pY_se_preps$treatment <- pY_se_preps$condition
pY_se_preps$prep <- unlist(prep_l[paste0("Xenograft_", rownames(colData(pY_se_preps)) )])
pY_se_preps_comp <- pY_se_preps
pY_se_preps_comp$condition <- pY_se_preps$prep

data_diff_prep1_vs_prep2_pY <- test_diff(pY_se_preps_comp, type = "manual", 
                              test = c("prep1_vs_prep2"))
## Tested contrasts: prep1_vs_prep2
dep_prep1_vs_prep2_pY <- add_rejections_SH(data_diff_prep1_vs_prep2_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_prep1_vs_prep2_pY, contrast = "prep1_vs_prep2", label_size = 2, add_names = TRUE, additional_title = "pY"))
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Return_DEP_Hits_Plots(data = pY_noNA, dep_prep1_vs_prep2_pY, comparison = "prep1_vs_prep2_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

##                                              pathway       pval      padj
## 1:                         ABC transporter disorders 0.54635108 0.7414198
## 2:            ABC-family proteins mediated transport 0.54635108 0.7414198
## 3:         ADP signalling through P2Y purinoceptor 1 0.87272727 0.9189189
## 4:                             ALK mutants bind TKIs 0.06262626 0.2870370
## 5: APC/C-mediated degradation of cell cycle proteins 0.37731959 0.7141142
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.51479290 0.7414198
##       log2err         ES        NES size leadingEdge
## 1: 0.07380527 -0.7329193 -0.9802338    1        5687
## 2: 0.07380527 -0.7329193 -0.9802338    1        5687
## 3: 0.05237591  0.5652174  0.7453080    1        1432
## 4: 0.25720647  0.9689441  1.2776709    1        1213
## 5: 0.09656296 -0.7375000 -1.1330785    2    983,5687
## 6: 0.07687367 -0.7453416 -0.9968479    1         983
#data_results <- get_df_long(dep)

Runs

pY_se_runs <- pY_se

pY_se_runs$treatment <- pY_se_runs$condition
pY_se_runs$run <- str_split(colnames(pY_se_runs), pattern = "_", simplify = TRUE)[,4]
pY_se_runs_comp <- pY_se_runs
pY_se_runs_comp$condition <- pY_se_runs$run

data_diff_Set1_vs_Set2_pY <- test_diff(pY_se_runs_comp, type = "manual", 
                              test = c("Set1_vs_Set2"))
## Tested contrasts: Set1_vs_Set2
dep_Set1_vs_Set2_pY <- add_rejections_SH(data_diff_Set1_vs_Set2_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_Set1_vs_Set2_pY, contrast = "Set1_vs_Set2", label_size = 2, add_names = TRUE, additional_title = "pY") )
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Return_DEP_Hits_Plots(data = pY_noNA, dep_Set1_vs_Set2_pY, comparison = "Set1_vs_Set2_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns
##                                              pathway      pval      padj
## 1:                         ABC transporter disorders 0.4891089 0.7661997
## 2:            ABC-family proteins mediated transport 0.4891089 0.7661997
## 3:         ADP signalling through P2Y purinoceptor 1 0.8229376 0.9308113
## 4:                             ALK mutants bind TKIs 0.1106640 0.4497354
## 5: APC/C-mediated degradation of cell cycle proteins 0.4334862 0.7661997
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.7049505 0.8763396
##       log2err         ES        NES size leadingEdge
## 1: 0.07977059 -0.7453416 -0.9866071    1        5687
## 2: 0.07977059 -0.7453416 -0.9866071    1        5687
## 3: 0.05490737  0.5900621  0.7849932    1        1432
## 4: 0.19002331  0.9503106  1.2642522    1        1213
## 5: 0.09466462 -0.6750000 -1.0631931    2    5687,983
## 6: 0.06143641 -0.6708075 -0.8879464    1         983
## Warning in max(screen_pval05_pos[, logFcColStr]): no non-missing arguments to
## max; returning -Inf
## Warning in min(x): no non-missing arguments to min; returning Inf
## Warning in max(x): no non-missing arguments to max; returning -Inf
## Warning in min(x): no non-missing arguments to min; returning Inf
## Warning in max(x): no non-missing arguments to max; returning -Inf
## Warning in min(cs1s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs1s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in min(cs2s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs2s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in min(cs3s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs3s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf

#data_results <- get_df_long(dep)

Prep 1

Each condition vs ctrl

pY_se_prep1 <- pY_se_preps
pY_se_prep1 <- pY_se_prep1[,pY_se_prep1$prep == "prep1" ]
data_diff_ctrl_vs_E_pY <- test_diff(pY_se_prep1, type="manual", test = "E_vs_ctrl")
## Tested contrasts: E_vs_ctrl
dep_ctrl_vs_E_pY <- add_rejections_SH(data_diff_ctrl_vs_E_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_ctrl_vs_E_pY, contrast = "E_vs_ctrl", 
                label_size = 2, add_names = TRUE,
                additional_title = "pY"))
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
paste0("log2FC_Xenograft_", colnames(pY_se_prep1) )
##  [1] "log2FC_Xenograft_EC_24h_2_Set1"  "log2FC_Xenograft_EC_24h_5_Set1" 
##  [3] "log2FC_Xenograft_E_24h_4_Set1"   "log2FC_Xenograft_EC_24h_1_Set1" 
##  [5] "log2FC_Xenograft_EBC_24h_3_Set1" "log2FC_Xenograft_ctrl_5d_3_Set1"
##  [7] "log2FC_Xenograft_E_24h_1_Set1"   "log2FC_Xenograft_E_24h_2_Set1"  
##  [9] "log2FC_Xenograft_EBC_24h_2_Set1" "log2FC_Xenograft_EBC_24h_4_Set1"
## [11] "log2FC_Xenograft_E_24h_5_Set1"   "log2FC_Xenograft_E_24h_3_Set1"  
## [13] "log2FC_Xenograft_EC_24h_4_Set1"  "log2FC_Xenograft_EC_24h_3_Set1" 
## [15] "log2FC_Xenograft_EBC_24h_1_Set1" "log2FC_Xenograft_ctrl_5d_3_Set2"
str_remove( colnames(pY_noNA), "log2FC_Xenograft_" )
##  [1] "Annotated_Sequence"          "HGNC_Symbol"                
##  [3] "EC_24h_2_Set1"               "EC_24h_5_Set1"              
##  [5] "E_24h_4_Set1"                "ctrl_5d_7_Set1"             
##  [7] "EC_24h_1_Set1"               "EBC_24h_3_Set1"             
##  [9] "ctrl_5d_3_Set1"              "E_24h_1_Set1"               
## [11] "E_24h_2_Set1"                "EBC_24h_2_Set1"             
## [13] "EBC_24h_4_Set1"              "E_24h_5_Set1"               
## [15] "E_24h_3_Set1"                "ctrl_5d_5_Set1"             
## [17] "EC_24h_4_Set1"               "EC_24h_3_Set1"              
## [19] "EBC_24h_1_Set1"              "EBC_5d_4_Set2"              
## [21] "ctrl_5d_7_Set2"              "EC_5d_3_Set2"               
## [23] "ctrl_5d_5_Set2"              "E_5d_2_Set2"                
## [25] "EBC_5d_3_Set2"               "E_5d_3_Set2"                
## [27] "EBC_5d_2_Set2"               "ctrl_5d_3_Set2"             
## [29] "E_5d_4_Set2"                 "EC_5d_4_Set2"               
## [31] "E_5d_5_Set2"                 "EC_5d_2_Set2"               
## [33] "EC_5d_1_Set2"                "EBC_5d_1_Set2"              
## [35] "EC_5d_5_Set2"                "EBC_5d_5_Set2"              
## [37] "Master.Protein.Accessions"   "Master.Protein.Descriptions"
pY_noNA %>% select()
## # A tibble: 231 × 0
Return_DEP_Hits_Plots(data = pY_noNA , 
                      dep_ctrl_vs_E_pY, 
                      comparison = "E_vs_ctrl_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns
##                                              pathway      pval      padj
## 1:                         ABC transporter disorders 0.7454910 0.9111018
## 2:            ABC-family proteins mediated transport 0.7454910 0.9111018
## 3:         ADP signalling through P2Y purinoceptor 1 0.1903808 0.9111018
## 4:                             ALK mutants bind TKIs 0.3366733 0.9111018
## 5: APC/C-mediated degradation of cell cycle proteins 0.7447217 0.9111018
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.9438878 0.9771684
##       log2err        ES       NES size leadingEdge
## 1: 0.05934877 0.6459627 0.8520523    1        5687
## 2: 0.05934877 0.6459627 0.8520523    1        5687
## 3: 0.14122512 0.9192547 1.2125360    1        1432
## 4: 0.10171390 0.8385093 1.1060294    1        1213
## 5: 0.05736674 0.5437500 0.8123386    2    5687,983
## 6: 0.04840876 0.5403727 0.7127745    1         983
## Warning in min(screen_pval05_neg[, logFcColStr]): no non-missing arguments to
## min; returning Inf
## Warning in min(x): no non-missing arguments to min; returning Inf
## Warning in max(x): no non-missing arguments to max; returning -Inf
## Warning in min(x): no non-missing arguments to min; returning Inf
## Warning in max(x): no non-missing arguments to max; returning -Inf
## Warning in min(cs1s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs1s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in min(cs2s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs2s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in min(cs3s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs3s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf

## Note: Row-scaling applied for this heatmap

Return_DEP_Hits_Plots(data = pY_noNA , 
                      dep_ctrl_vs_E_pY, 
                      comparison = "E_vs_ctrl_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns
##                                              pathway      pval      padj
## 1:                         ABC transporter disorders 0.7338710 0.9137037
## 2:            ABC-family proteins mediated transport 0.7338710 0.9137037
## 3:         ADP signalling through P2Y purinoceptor 1 0.1975806 0.9137037
## 4:                             ALK mutants bind TKIs 0.3447581 0.9137037
## 5: APC/C-mediated degradation of cell cycle proteins 0.7348928 0.9137037
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.9314516 0.9687697
##       log2err        ES       NES size leadingEdge
## 1: 0.06037864 0.6459627 0.8533917    1        5687
## 2: 0.06037864 0.6459627 0.8533917    1        5687
## 3: 0.13880511 0.9192547 1.2144420    1        1432
## 4: 0.10063339 0.8385093 1.1077681    1        1213
## 5: 0.05871859 0.5437500 0.8157366    2    5687,983
## 6: 0.04929177 0.5403727 0.7138950    1         983
## Warning in min(screen_pval05_neg[, logFcColStr]): no non-missing arguments to
## min; returning Inf
## Warning in min(x): no non-missing arguments to min; returning Inf
## Warning in max(x): no non-missing arguments to max; returning -Inf
## Warning in min(x): no non-missing arguments to min; returning Inf
## Warning in max(x): no non-missing arguments to max; returning -Inf
## Warning in min(cs1s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs1s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in min(cs2s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs2s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in min(cs3s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs3s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf

## Note: Row-scaling applied for this heatmap

data_diff_EC_vs_ctrl_pY <- test_diff(pY_se_prep1, type="manual", test = "EC_vs_ctrl")
## Tested contrasts: EC_vs_ctrl
dep_EC_vs_ctrl_pY <- add_rejections_SH(data_diff_EC_vs_ctrl_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_EC_vs_ctrl_pY, contrast = "EC_vs_ctrl", 
                label_size = 2, add_names = TRUE,
                additional_title = "pY"))
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Return_DEP_Hits_Plots(data = pY_noNA, dep_EC_vs_ctrl_pY, comparison = "EC_vs_ctrl_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns
##                                              pathway      pval      padj
## 1:                         ABC transporter disorders 0.8000000 0.9676585
## 2:            ABC-family proteins mediated transport 0.8000000 0.9676585
## 3:         ADP signalling through P2Y purinoceptor 1 0.1341223 0.9676585
## 4:                             ALK mutants bind TKIs 0.3195266 0.9676585
## 5: APC/C-mediated degradation of cell cycle proteins 0.6975169 0.9676585
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.9414141 0.9769392
##       log2err         ES        NES size leadingEdge
## 1: 0.05641184 -0.6149068 -0.8169927    1        5687
## 2: 0.05641184 -0.6149068 -0.8169927    1        5687
## 3: 0.16957064  0.9254658  1.2522672    1        1432
## 4: 0.10395847  0.8385093  1.1346045    1        1213
## 5: 0.06831109 -0.5437500 -0.8514943    2    5687,983
## 6: 0.04889708 -0.5403727 -0.7179633    1         983
## Warning in min(screen_pval05_neg[, logFcColStr]): no non-missing arguments to
## min; returning Inf
## Warning in min(x): no non-missing arguments to min; returning Inf
## Warning in max(x): no non-missing arguments to max; returning -Inf
## Warning in min(x): no non-missing arguments to min; returning Inf
## Warning in max(x): no non-missing arguments to max; returning -Inf
## Warning in min(cs1s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs1s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in min(cs2s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs2s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in min(cs3s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs3s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf

## Note: Row-scaling applied for this heatmap

Plot_Enrichment_Single_Pathway(dep_EC_vs_ctrl_pY, comparison = "EC_vs_ctrl_diff", 
                               pw = "Epigenetic regulation of gene expression")
data_diff_EBC_vs_ctrl_pY <- test_diff(pY_se_prep1, type="manual", test = "EBC_vs_ctrl")
## Tested contrasts: EBC_vs_ctrl
dep_EBC_vs_ctrl_pY <- add_rejections_SH(data_diff_EBC_vs_ctrl_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_EBC_vs_ctrl_pY, contrast = "EBC_vs_ctrl", 
                label_size = 2, add_names = TRUE,
                additional_title = "pY"))
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Return_DEP_Hits_Plots(data = pY_noNA, dep_EBC_vs_ctrl_pY, comparison = "EBC_vs_ctrl_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns
##                                              pathway      pval     padj
## 1:                         ABC transporter disorders 0.6827309 0.884146
## 2:            ABC-family proteins mediated transport 0.6827309 0.884146
## 3:         ADP signalling through P2Y purinoceptor 1 0.3194444 0.884146
## 4:                             ALK mutants bind TKIs 0.2718254 0.884146
## 5: APC/C-mediated degradation of cell cycle proteins 0.5010183 0.884146
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.5401606 0.884146
##       log2err         ES        NES size leadingEdge
## 1: 0.06364241 -0.6645963 -0.8819656    1        5687
## 2: 0.06364241 -0.6645963 -0.8819656    1        5687
## 3: 0.10434395  0.8571429  1.1358118    1        1432
## 4: 0.11475072  0.8757764  1.1605033    1        1213
## 5: 0.07998588 -0.6687500 -1.0433186    2    983,5687
## 6: 0.07530938 -0.7329193 -0.9726350    1         983
## Warning in min(screen_pval05_neg[, logFcColStr]): no non-missing arguments to
## min; returning Inf
## Warning in min(x): no non-missing arguments to min; returning Inf
## Warning in max(x): no non-missing arguments to max; returning -Inf
## Warning in min(x): no non-missing arguments to min; returning Inf
## Warning in max(x): no non-missing arguments to max; returning -Inf
## Warning in min(cs1s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs1s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in min(cs2s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs2s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in min(cs3s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs3s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf

## Note: Row-scaling applied for this heatmap

EC vs E

data_diff_EC_vs_E_pY <- test_diff(pY_se_prep1, type = "manual", 
                              test = c("EC_vs_E"))
## Tested contrasts: EC_vs_E
dep_EC_vs_E_pY <- add_rejections_SH(data_diff_EC_vs_E_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_EC_vs_E_pY, contrast = "EC_vs_E", label_size = 2, add_names = TRUE, additional_title = "pY"))
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Return_DEP_Hits_Plots(data = pY_noNA, dep_EC_vs_E_pY, comparison = "EC_vs_E_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns
##                                              pathway      pval      padj
## 1:                         ABC transporter disorders 0.1949807 0.6159019
## 2:            ABC-family proteins mediated transport 0.1949807 0.6159019
## 3:         ADP signalling through P2Y purinoceptor 1 0.8533058 0.9397419
## 4:                             ALK mutants bind TKIs 0.3455598 0.7036098
## 5: APC/C-mediated degradation of cell cycle proteins 0.3657957 0.7036098
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.5540541 0.7475332
##       log2err         ES        NES size leadingEdge
## 1: 0.13649044 -0.9068323 -1.2244229    1        5687
## 2: 0.13649044 -0.9068323 -1.2244229    1        5687
## 3: 0.05445560  0.5900621  0.7817798    1        1432
## 4: 0.09787733 -0.8136646 -1.0986260    1        1213
## 5: 0.10714024 -0.7187500 -1.1218142    2    5687,983
## 6: 0.07200331 -0.7142857 -0.9644427    1         983
## Warning in min(screen_pval05_neg[, logFcColStr]): no non-missing arguments to
## min; returning Inf
## Warning in min(x): no non-missing arguments to min; returning Inf
## Warning in max(x): no non-missing arguments to max; returning -Inf
## Warning in min(x): no non-missing arguments to min; returning Inf
## Warning in max(x): no non-missing arguments to max; returning -Inf
## Warning in min(cs1s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs1s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in min(cs2s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs2s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in min(cs3s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs3s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf

## Note: Row-scaling applied for this heatmap

#data_results <- get_df_long(dep)

EBC vs EC

data_diff_EC_vs_EBC_pY <- test_diff(pY_se_prep1, type = "manual", 
                              test = c("EC_vs_EBC"))
## Tested contrasts: EC_vs_EBC
dep_EC_vs_EBC_pY <- add_rejections_SH(data_diff_EC_vs_EBC_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_EC_vs_EBC_pY, contrast = "EC_vs_EBC", label_size = 2, add_names = TRUE, additional_title = "pY"))
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Return_DEP_Hits_Plots(data = pY_noNA, dep_EC_vs_EBC_pY, comparison = "EC_vs_EBC_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

##                                              pathway      pval      padj
## 1:                         ABC transporter disorders 0.9529412 0.9705882
## 2:            ABC-family proteins mediated transport 0.9529412 0.9705882
## 3:         ADP signalling through P2Y purinoceptor 1 0.1568627 0.5843293
## 4:                             ALK mutants bind TKIs 0.4552846 0.8378932
## 5: APC/C-mediated degradation of cell cycle proteins 0.8151571 0.9587068
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.5529412 0.8631660
##       log2err         ES        NES size leadingEdge
## 1: 0.04697587  0.5279503  0.7111159    1        5687
## 2: 0.04697587  0.5279503  0.7111159    1        5687
## 3: 0.15524197  0.9192547  1.2381782    1        1432
## 4: 0.08504275 -0.7701863 -1.0319147    1        1213
## 5: 0.05142649  0.5312500  0.7977784    2    983,5687
## 6: 0.07289386  0.7142857  0.9620979    1         983
#data_results <- get_df_long(dep)

Prep 2

Each condition vs ctrl

pY_se_prep2 <- pY_se_preps
pY_se_prep2 <- pY_se_prep2[,pY_se_prep2$prep == "prep2" ]
data_diff_ctrl_vs_E_pY <- test_diff(pY_se_prep2, type="manual", test = "E_vs_ctrl")
## Tested contrasts: E_vs_ctrl
dep_ctrl_vs_E_pY <- add_rejections_SH(data_diff_ctrl_vs_E_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_ctrl_vs_E_pY, contrast = "E_vs_ctrl", 
                label_size = 2, add_names = TRUE,
                additional_title = "pY"))
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
paste0("log2FC_Xenograft_", colnames(pY_se_prep2) )
##  [1] "log2FC_Xenograft_ctrl_5d_7_Set1" "log2FC_Xenograft_ctrl_5d_5_Set1"
##  [3] "log2FC_Xenograft_EBC_5d_4_Set2"  "log2FC_Xenograft_ctrl_5d_7_Set2"
##  [5] "log2FC_Xenograft_EC_5d_3_Set2"   "log2FC_Xenograft_ctrl_5d_5_Set2"
##  [7] "log2FC_Xenograft_E_5d_2_Set2"    "log2FC_Xenograft_EBC_5d_3_Set2" 
##  [9] "log2FC_Xenograft_E_5d_3_Set2"    "log2FC_Xenograft_EBC_5d_2_Set2" 
## [11] "log2FC_Xenograft_E_5d_4_Set2"    "log2FC_Xenograft_EC_5d_4_Set2"  
## [13] "log2FC_Xenograft_E_5d_5_Set2"    "log2FC_Xenograft_EC_5d_2_Set2"  
## [15] "log2FC_Xenograft_EC_5d_1_Set2"   "log2FC_Xenograft_EBC_5d_1_Set2" 
## [17] "log2FC_Xenograft_EC_5d_5_Set2"   "log2FC_Xenograft_EBC_5d_5_Set2"
str_remove( colnames(pY_noNA), "log2FC_Xenograft_" )
##  [1] "Annotated_Sequence"          "HGNC_Symbol"                
##  [3] "EC_24h_2_Set1"               "EC_24h_5_Set1"              
##  [5] "E_24h_4_Set1"                "ctrl_5d_7_Set1"             
##  [7] "EC_24h_1_Set1"               "EBC_24h_3_Set1"             
##  [9] "ctrl_5d_3_Set1"              "E_24h_1_Set1"               
## [11] "E_24h_2_Set1"                "EBC_24h_2_Set1"             
## [13] "EBC_24h_4_Set1"              "E_24h_5_Set1"               
## [15] "E_24h_3_Set1"                "ctrl_5d_5_Set1"             
## [17] "EC_24h_4_Set1"               "EC_24h_3_Set1"              
## [19] "EBC_24h_1_Set1"              "EBC_5d_4_Set2"              
## [21] "ctrl_5d_7_Set2"              "EC_5d_3_Set2"               
## [23] "ctrl_5d_5_Set2"              "E_5d_2_Set2"                
## [25] "EBC_5d_3_Set2"               "E_5d_3_Set2"                
## [27] "EBC_5d_2_Set2"               "ctrl_5d_3_Set2"             
## [29] "E_5d_4_Set2"                 "EC_5d_4_Set2"               
## [31] "E_5d_5_Set2"                 "EC_5d_2_Set2"               
## [33] "EC_5d_1_Set2"                "EBC_5d_1_Set2"              
## [35] "EC_5d_5_Set2"                "EBC_5d_5_Set2"              
## [37] "Master.Protein.Accessions"   "Master.Protein.Descriptions"
pY_noNA %>% select()
## # A tibble: 231 × 0
Return_DEP_Hits_Plots(data = pY_noNA , 
                      dep_ctrl_vs_E_pY, 
                      comparison = "E_vs_ctrl_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

##                                              pathway       pval      padj
## 1:                         ABC transporter disorders 0.66666667 0.9671838
## 2:            ABC-family proteins mediated transport 0.66666667 0.9671838
## 3:         ADP signalling through P2Y purinoceptor 1 0.90419162 0.9671838
## 4:                             ALK mutants bind TKIs 0.66866267 0.9671838
## 5: APC/C-mediated degradation of cell cycle proteins 0.37547893 0.9671838
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.07984032 0.8735720
##       log2err         ES        NES size leadingEdge
## 1: 0.06450312 -0.6645963 -0.8858936    1        5687
## 2: 0.06450312 -0.6645963 -0.8858936    1        5687
## 3: 0.05019343  0.5527950  0.7392518    1        1432
## 4: 0.06435834  0.6645963  0.8887634    1        1213
## 5: 0.09255289 -0.6894069 -1.0702955    2         983
## 6: 0.22496609 -0.9565217 -1.2750244    1         983
Return_DEP_Hits_Plots(data = pY_noNA , 
                      dep_ctrl_vs_E_pY, 
                      comparison = "E_vs_ctrl_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

##                                              pathway      pval     padj
## 1:                         ABC transporter disorders 0.6731898 0.968303
## 2:            ABC-family proteins mediated transport 0.6731898 0.968303
## 3:         ADP signalling through P2Y purinoceptor 1 0.9164969 0.968303
## 4:                             ALK mutants bind TKIs 0.7189409 0.968303
## 5: APC/C-mediated degradation of cell cycle proteins 0.3865385 0.968303
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.1017613 0.968303
##       log2err         ES        NES size leadingEdge
## 1: 0.06307904 -0.6645963 -0.8878223    1        5687
## 2: 0.06307904 -0.6645963 -0.8878223    1        5687
## 3: 0.05049830  0.5527950  0.7258897    1        1432
## 4: 0.06184060  0.6645963  0.8726988    1        1213
## 5: 0.09110731 -0.6894069 -1.0778980    2         983
## 6: 0.19578900 -0.9565217 -1.2778004    1         983
data_diff_EC_vs_ctrl_pY <- test_diff(pY_se_prep2, type="manual", test = "EC_vs_ctrl")
## Tested contrasts: EC_vs_ctrl
dep_EC_vs_ctrl_pY <- add_rejections_SH(data_diff_EC_vs_ctrl_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_EC_vs_ctrl_pY, contrast = "EC_vs_ctrl", 
                label_size = 2, add_names = TRUE,
                additional_title = "pY"))
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Return_DEP_Hits_Plots(data = pY_noNA, dep_EC_vs_ctrl_pY, comparison = "EC_vs_ctrl_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

##                                              pathway      pval      padj
## 1:                         ABC transporter disorders 0.5637066 0.7433930
## 2:            ABC-family proteins mediated transport 0.5637066 0.7433930
## 3:         ADP signalling through P2Y purinoceptor 1 1.0000000 1.0000000
## 4:                             ALK mutants bind TKIs 0.9555985 0.9786249
## 5: APC/C-mediated degradation of cell cycle proteins 0.5943396 0.7622874
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.4090909 0.7000087
##       log2err         ES        NES size leadingEdge
## 1: 0.07113274  0.6956522  0.9368367    1        5687
## 2: 0.07113274  0.6956522  0.9368367    1        5687
## 3: 0.04716425 -0.5031056 -0.6700750    1        1432
## 4: 0.04613792  0.5279503  0.7109921    1        1213
## 5: 0.05859376 -0.5848001 -0.9250701    2         983
## 6: 0.09196861 -0.7950311 -1.0588840    1         983

## Note: Row-scaling applied for this heatmap

Plot_Enrichment_Single_Pathway(dep_EC_vs_ctrl_pY, comparison = "EC_vs_ctrl_diff", 
                               pw = "Epigenetic regulation of gene expression")
data_diff_EBC_vs_ctrl_pY <- test_diff(pY_se_prep2, type="manual", test = "EBC_vs_ctrl")
## Tested contrasts: EBC_vs_ctrl
dep_EBC_vs_ctrl_pY <- add_rejections_SH(data_diff_EBC_vs_ctrl_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_EBC_vs_ctrl_pY, contrast = "EBC_vs_ctrl", 
                label_size = 2, add_names = TRUE,
                additional_title = "pY"))
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Return_DEP_Hits_Plots(data = pY_noNA, dep_EBC_vs_ctrl_pY, comparison = "EBC_vs_ctrl_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

##                                              pathway      pval      padj
## 1:                         ABC transporter disorders 0.1401674 0.3733803
## 2:            ABC-family proteins mediated transport 0.1401674 0.3733803
## 3:         ADP signalling through P2Y purinoceptor 1 0.9790076 0.9860967
## 4:                             ALK mutants bind TKIs 0.3053435 0.5396903
## 5: APC/C-mediated degradation of cell cycle proteins 0.1791908 0.4096414
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.5543933 0.6731919
##       log2err         ES        NES size leadingEdge
## 1: 0.17093234  0.9316770  1.2399487    1        5687
## 2: 0.17093234  0.9316770  1.2399487    1        5687
## 3: 0.04450705 -0.5155280 -0.6765953    1        1432
## 4: 0.10473282 -0.8571429 -1.1249416    1        1213
## 5: 0.17821987  0.7375000  1.2521044    2        5687
## 6: 0.07608372  0.7329193  0.9754263    1         983

EC vs E

data_diff_EC_vs_E_pY <- test_diff(pY_se_prep2, type = "manual", 
                              test = c("EC_vs_E"))
## Tested contrasts: EC_vs_E
dep_EC_vs_E_pY <- add_rejections_SH(data_diff_EC_vs_E_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_EC_vs_E_pY, contrast = "EC_vs_E", label_size = 2, add_names = TRUE, additional_title = "pY"))
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Return_DEP_Hits_Plots(data = pY_noNA, dep_EC_vs_E_pY, comparison = "EC_vs_E_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

##                                              pathway       pval      padj
## 1:                         ABC transporter disorders 0.22515213 0.4323405
## 2:            ABC-family proteins mediated transport 0.22515213 0.4323405
## 3:         ADP signalling through P2Y purinoceptor 1 0.90373281 0.9515655
## 4:                             ALK mutants bind TKIs 0.96957404 0.9832448
## 5: APC/C-mediated degradation of cell cycle proteins 0.04223675 0.3014608
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.21095335 0.4323405
##       log2err         ES        NES size leadingEdge
## 1: 0.12944289  0.8881988  1.1814610    1        5687
## 2: 0.12944289  0.8881988  1.1814610    1        5687
## 3: 0.04949049 -0.5527950 -0.7327596    1        1432
## 4: 0.04773424  0.5093168  0.6774811    1        1213
## 5: 0.32177592  0.8937500  1.4579291    2    983,5687
## 6: 0.13427345  0.8944099  1.1897229    1         983

## Note: Row-scaling applied for this heatmap

#data_results <- get_df_long(dep)

EBC vs EC

data_diff_EC_vs_EBC_pY <- test_diff(pY_se_prep2, type = "manual", 
                              test = c("EC_vs_EBC"))
## Tested contrasts: EC_vs_EBC
dep_EC_vs_EBC_pY <- add_rejections_SH(data_diff_EC_vs_EBC_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_EC_vs_EBC_pY, contrast = "EC_vs_EBC", label_size = 2, add_names = TRUE, additional_title = "pY"))
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Return_DEP_Hits_Plots(data = pY_noNA, dep_EC_vs_EBC_pY, comparison = "EC_vs_EBC_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

##                                              pathway       pval      padj
## 1:                         ABC transporter disorders 0.14951456 0.4224357
## 2:            ABC-family proteins mediated transport 0.14951456 0.4224357
## 3:         ADP signalling through P2Y purinoceptor 1 0.94951456 0.9713305
## 4:                             ALK mutants bind TKIs 0.16016427 0.4224357
## 5: APC/C-mediated degradation of cell cycle proteins 0.02098680 0.3567757
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.06407767 0.4220706
##      log2err         ES        NES size leadingEdge
## 1: 0.1585141 -0.9316770 -1.2389125    1        5687
## 2: 0.1585141 -0.9316770 -1.2389125    1        5687
## 3: 0.0466948 -0.5341615 -0.7103098    1        1432
## 4: 0.1574029  0.9130435  1.2236153    1        1213
## 5: 0.3524879 -0.9375000 -1.5339514    2    983,5687
## 6: 0.2489111 -0.9689441 -1.2884690    1         983

## Note: Row-scaling applied for this heatmap

#data_results <- get_df_long(dep)

Tyrosine 24h

Each condition vs ctrl

pY_se_24h <- pY_se

pY_se_24h <- pY_se_24h[,pY_se_24h$day == "24h" | (pY_se_24h$day == "5d" & pY_se_24h$condition == "ctrl")]

data_diff_ctrl_vs_E_pY <- test_diff(pY_se_24h, type="manual", test = "E_vs_ctrl")
## Tested contrasts: E_vs_ctrl
dep_ctrl_vs_E_pY <- add_rejections_SH(data_diff_ctrl_vs_E_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_ctrl_vs_E_pY, contrast = "E_vs_ctrl", 
                label_size = 2, add_names = TRUE,
                additional_title = "pY"))
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Return_DEP_Hits_Plots(data = pY_noNA, dep_ctrl_vs_E_pY, comparison = "E_vs_ctrl_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

##                                              pathway      pval      padj
## 1:                         ABC transporter disorders 0.5380117 0.8623487
## 2:            ABC-family proteins mediated transport 0.5380117 0.8623487
## 3:         ADP signalling through P2Y purinoceptor 1 0.2553606 0.8169134
## 4:                             ALK mutants bind TKIs 0.6298569 0.8984595
## 5: APC/C-mediated degradation of cell cycle proteins 0.6138614 0.8954140
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.7586912 0.9229336
##       log2err         ES        NES size leadingEdge
## 1: 0.07399014  0.7391304  0.9875199    1        5687
## 2: 0.07399014  0.7391304  0.9875199    1        5687
## 3: 0.11776579  0.8695652  1.1617881    1        1432
## 4: 0.06847149 -0.6956522 -0.9225576    1        1213
## 5: 0.05934877 -0.5903616 -0.9166824    2         983
## 6: 0.05947603 -0.6335404 -0.8401863    1         983

## Note: Row-scaling applied for this heatmap

data_diff_EC_vs_ctrl_pY <- test_diff(pY_se_24h, type="manual", test = "EC_vs_ctrl")
## Tested contrasts: EC_vs_ctrl
dep_EC_vs_ctrl_pY <- add_rejections_SH(data_diff_EC_vs_ctrl_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_EC_vs_ctrl_pY, contrast = "EC_vs_ctrl", 
                label_size = 2, add_names = TRUE,
                additional_title = "pY"))
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Return_DEP_Hits_Plots(data = pY_noNA, dep_EC_vs_ctrl_pY, comparison = "EC_vs_ctrl_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

##                                              pathway      pval      padj
## 1:                         ABC transporter disorders 0.8775510 0.9535147
## 2:            ABC-family proteins mediated transport 0.8775510 0.9535147
## 3:         ADP signalling through P2Y purinoceptor 1 0.2578125 0.8872969
## 4:                             ALK mutants bind TKIs 0.3020408 0.8901872
## 5: APC/C-mediated degradation of cell cycle proteins 0.6819788 0.9295192
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.4755102 0.8901872
##       log2err         ES        NES size leadingEdge
## 1: 0.05258990 -0.5652174 -0.7495957    1        5687
## 2: 0.05258990 -0.5652174 -0.7495957    1        5687
## 3: 0.11724972  0.8881988  1.1662384    1        1432
## 4: 0.10968406 -0.8447205 -1.1202749    1        1213
## 5: 0.05760911 -0.5687500 -0.8653430    2    983,5687
## 6: 0.08289621 -0.7639752 -1.0131898    1         983
Plot_Enrichment_Single_Pathway(dep_EC_vs_ctrl_pY, comparison = "EC_vs_ctrl_diff", 
                               pw = "Epigenetic regulation of gene expression")
data_diff_EBC_vs_ctrl_pY <- test_diff(pY_se_24h, type="manual", test = "EBC_vs_ctrl")
## Tested contrasts: EBC_vs_ctrl
dep_EBC_vs_ctrl_pY <- add_rejections_SH(data_diff_EBC_vs_ctrl_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_EBC_vs_ctrl_pY, contrast = "EBC_vs_ctrl", 
                label_size = 2, add_names = TRUE,
                additional_title = "pY"))
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Return_DEP_Hits_Plots(data = pY_noNA, dep_EBC_vs_ctrl_pY, comparison = "EBC_vs_ctrl_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

##                                              pathway      pval      padj
## 1:                         ABC transporter disorders 0.8264300 0.9124368
## 2:            ABC-family proteins mediated transport 0.8264300 0.9124368
## 3:         ADP signalling through P2Y purinoceptor 1 0.6242424 0.9021123
## 4:                             ALK mutants bind TKIs 0.3570020 0.8626744
## 5: APC/C-mediated degradation of cell cycle proteins 0.5987055 0.8862559
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.1715976 0.7302463
##       log2err         ES        NES size leadingEdge
## 1: 0.05378728 -0.6024845 -0.8034639    1        5687
## 2: 0.05378728 -0.6024845 -0.8034639    1        5687
## 3: 0.06831109  0.6956522  0.9233491    1        1432
## 4: 0.09721508 -0.8198758 -1.0933735    1        1213
## 5: 0.05960370 -0.6062500 -0.9410346    2    983,5687
## 6: 0.14826150 -0.9068323 -1.2093373    1         983

## Note: Row-scaling applied for this heatmap

Not ctrl vs ctrl

data_diff_vs_ctrl_pY <- test_diff_to_all_other(pY_se_24h, control = "ctrl")
dep_vs_ctrl_pY <- add_rejections_SH(data_diff_vs_ctrl_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_vs_ctrl_pY, contrast = "not_ctrl_vs_ctrl", label_size = 2, add_names = TRUE, additional_title = "pY"))
Return_DEP_Hits_Plots(data = pY_noNA, dep_vs_ctrl_pY, comparison = "not_ctrl_vs_ctrl_diff")

EC vs E

data_diff_EC_vs_E_pY <- test_diff(pY_se_24h, type = "manual", 
                              test = c("EC_vs_E"))
## Tested contrasts: EC_vs_E
dep_EC_vs_E_pY <- add_rejections_SH(data_diff_EC_vs_E_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_EC_vs_E_pY, contrast = "EC_vs_E", label_size = 2, add_names = TRUE, additional_title = "pY"))
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Return_DEP_Hits_Plots(data = pY_noNA, dep_EC_vs_E_pY, comparison = "EC_vs_E_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

##                                              pathway      pval      padj
## 1:                         ABC transporter disorders 0.2453222 0.6945422
## 2:            ABC-family proteins mediated transport 0.2453222 0.6945422
## 3:         ADP signalling through P2Y purinoceptor 1 0.8291747 0.9164046
## 4:                             ALK mutants bind TKIs 0.4012474 0.7575017
## 5: APC/C-mediated degradation of cell cycle proteins 0.3421687 0.7157219
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.5758836 0.7659333
##       log2err         ES        NES size leadingEdge
## 1: 0.12503337 -0.9068323 -1.1952721    1        5687
## 2: 0.12503337 -0.9068323 -1.1952721    1        5687
## 3: 0.05237591  0.5900621  0.7856359    1        1432
## 4: 0.09344492 -0.8136646 -1.0724702    1        1213
## 5: 0.11237852 -0.7187500 -1.1342458    2    5687,983
## 6: 0.07380527 -0.7142857 -0.9414815    1         983
#data_results <- get_df_long(dep)

EBC vs EC

data_diff_EC_vs_EBC_pY <- test_diff(pY_se_24h, type = "manual", 
                              test = c("EC_vs_EBC"))
## Tested contrasts: EC_vs_EBC
dep_EC_vs_EBC_pY <- add_rejections_SH(data_diff_EC_vs_EBC_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_EC_vs_EBC_pY, contrast = "EC_vs_EBC", label_size = 2, add_names = TRUE, additional_title = "pY"))
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Return_DEP_Hits_Plots(data = pY_noNA, dep_EC_vs_EBC_pY, comparison = "EC_vs_EBC_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

##                                              pathway      pval      padj
## 1:                         ABC transporter disorders 0.9540230 0.9738117
## 2:            ABC-family proteins mediated transport 0.9540230 0.9738117
## 3:         ADP signalling through P2Y purinoceptor 1 0.1685824 0.6051969
## 4:                             ALK mutants bind TKIs 0.4895833 0.8881421
## 5: APC/C-mediated degradation of cell cycle proteins 0.8163636 0.9722946
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.5842912 0.9044905
##       log2err         ES        NES size leadingEdge
## 1: 0.04586203  0.5279503  0.7004350    1        5687
## 2: 0.04586203  0.5279503  0.7004350    1        5687
## 3: 0.14733121  0.9192547  1.2195809    1        1432
## 4: 0.08243441 -0.7701863 -1.0052126    1        1213
## 5: 0.05060042  0.5312500  0.7935850    2    983,5687
## 6: 0.06895674  0.7142857  0.9476473    1         983
#data_results <- get_df_long(dep)

Preps

pY_se_24h_preps <- pY_se_24h

pY_se_24h_preps$treatment <- pY_se_24h_preps$condition
pY_se_24h_preps$prep <- unlist(prep_l[paste0("Xenograft_", rownames(colData(pY_se_24h_preps)) )])
pY_se_24h_preps_comp <- pY_se_24h_preps
pY_se_24h_preps_comp$condition <- pY_se_24h_preps$prep

data_diff_prep1_vs_prep2_pY <- test_diff(pY_se_24h_preps_comp, type = "manual", 
                              test = c("prep1_vs_prep2"))
## Tested contrasts: prep1_vs_prep2
dep_prep1_vs_prep2_pY <- add_rejections_SH(data_diff_prep1_vs_prep2_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_prep1_vs_prep2_pY, contrast = "prep1_vs_prep2", label_size = 2, add_names = TRUE, additional_title = "pY"))
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Return_DEP_Hits_Plots(data = pY_noNA, dep_prep1_vs_prep2_pY, comparison = "prep1_vs_prep2_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

##                                              pathway      pval      padj
## 1:                         ABC transporter disorders 0.8785425 0.9314468
## 2:            ABC-family proteins mediated transport 0.8785425 0.9314468
## 3:         ADP signalling through P2Y purinoceptor 1 0.7429150 0.9314468
## 4:                             ALK mutants bind TKIs 0.6259843 0.9275678
## 5: APC/C-mediated degradation of cell cycle proteins 0.7388633 0.9314468
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.3602362 0.7105925
##       log2err         ES        NES size leadingEdge
## 1: 0.05216303  0.5590062  0.7381345    1        5687
## 2: 0.05216303  0.5590062  0.7381345    1        5687
## 3: 0.05998925  0.6459627  0.8529554    1        1432
## 4: 0.06689663 -0.7018634 -0.9278796    1        1213
## 5: 0.04744832 -0.5264515 -0.8246236    2         983
## 6: 0.09656296 -0.8322981 -1.1003174    1         983
#data_results <- get_df_long(dep)

Runs

pY_se_24h_runs <- pY_se_24h

pY_se_24h_runs$treatment <- pY_se_24h_runs$condition
pY_se_24h_runs$run <- str_split(colnames(pY_se_24h_runs), pattern = "_", simplify = TRUE)[,4]
pY_se_24h_runs_comp <- pY_se_24h_runs
pY_se_24h_runs_comp$condition <- pY_se_24h_runs$run

data_diff_Set1_vs_Set2_pY <- test_diff(pY_se_24h_runs_comp, type = "manual", 
                              test = c("Set1_vs_Set2"))
## Tested contrasts: Set1_vs_Set2
dep_Set1_vs_Set2_pY <- add_rejections_SH(data_diff_Set1_vs_Set2_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_Set1_vs_Set2_pY, contrast = "Set1_vs_Set2", label_size = 2, add_names = TRUE, additional_title = "pY"))
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Return_DEP_Hits_Plots(data = pY_noNA, dep_Set1_vs_Set2_pY, comparison = "Set1_vs_Set2_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns
##                                              pathway      pval      padj
## 1:                         ABC transporter disorders 0.7256461 0.8738145
## 2:            ABC-family proteins mediated transport 0.7256461 0.8738145
## 3:         ADP signalling through P2Y purinoceptor 1 0.4048096 0.8457711
## 4:                             ALK mutants bind TKIs 0.2027833 0.8457711
## 5: APC/C-mediated degradation of cell cycle proteins 0.5122378 0.8457711
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.5149105 0.8457711
##       log2err         ES        NES size leadingEdge
## 1: 0.06024841 -0.6335404 -0.8576597    1        5687
## 2: 0.06024841 -0.6335404 -0.8576597    1        5687
## 3: 0.09082414  0.7888199  1.0657343    1        1432
## 4: 0.13574094 -0.8819876 -1.1939969    1        1213
## 5: 0.07096095 -0.6375000 -0.9813769    2    983,5687
## 6: 0.07727470 -0.7329193 -0.9921946    1         983
## Warning in max(screen_pval05_pos[, logFcColStr]): no non-missing arguments to
## max; returning -Inf
## Warning in min(x): no non-missing arguments to min; returning Inf
## Warning in max(x): no non-missing arguments to max; returning -Inf
## Warning in min(x): no non-missing arguments to min; returning Inf
## Warning in max(x): no non-missing arguments to max; returning -Inf
## Warning in min(cs1s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs1s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in min(cs2s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs2s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in min(cs3s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs3s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf

## Note: Row-scaling applied for this heatmap

#data_results <- get_df_long(dep)

Tyrosine 5d

Each condition vs ctrl

pY_se_5d <- pY_se

pY_se_5d <- pY_se_5d[,pY_se_5d$day == "5d" ]

data_diff_ctrl_vs_E_pY <- test_diff(pY_se_5d, type="manual", test = "E_vs_ctrl")
## Tested contrasts: E_vs_ctrl
dep_ctrl_vs_E_pY <- add_rejections_SH(data_diff_ctrl_vs_E_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_ctrl_vs_E_pY, contrast = "E_vs_ctrl", 
                label_size = 2, add_names = TRUE,
                additional_title = "pY"))
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Return_DEP_Hits_Plots(data = pY_noNA, dep_ctrl_vs_E_pY, comparison = "E_vs_ctrl_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns
##                                              pathway      pval      padj
## 1:                         ABC transporter disorders 0.6114519 0.8809053
## 2:            ABC-family proteins mediated transport 0.6114519 0.8809053
## 3:         ADP signalling through P2Y purinoceptor 1 0.6413255 0.8925227
## 4:                             ALK mutants bind TKIs 0.7582846 0.9408976
## 5: APC/C-mediated degradation of cell cycle proteins 0.4456522 0.8809053
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.2044990 0.8809053
##       log2err         ES        NES size leadingEdge
## 1: 0.06994587 -0.6770186 -0.9105569    1        5687
## 2: 0.06994587 -0.6770186 -0.9105569    1        5687
## 3: 0.06523531  0.6770186  0.9054008    1        1432
## 4: 0.05724611  0.6273292  0.8389494    1        1213
## 5: 0.08998608 -0.6812500 -1.0671793    2    983,5687
## 6: 0.13725078 -0.9006211 -1.2112912    1         983
## Warning in min(screen_pval05_neg[, logFcColStr]): no non-missing arguments to
## min; returning Inf
## Warning in min(x): no non-missing arguments to min; returning Inf
## Warning in max(x): no non-missing arguments to max; returning -Inf
## Warning in min(x): no non-missing arguments to min; returning Inf
## Warning in max(x): no non-missing arguments to max; returning -Inf
## Warning in min(cs1s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs1s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in min(cs2s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs2s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in min(cs3s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs3s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf

## Note: Row-scaling applied for this heatmap

data_diff_EC_vs_ctrl_pY <- test_diff(pY_se_5d, type="manual", test = "EC_vs_ctrl")
## Tested contrasts: EC_vs_ctrl
dep_EC_vs_ctrl_pY <- add_rejections_SH(data_diff_EC_vs_ctrl_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_EC_vs_ctrl_pY, contrast = "EC_vs_ctrl", 
                label_size = 2, add_names = TRUE,
                additional_title = "pY"))
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Return_DEP_Hits_Plots(data = pY_noNA, dep_EC_vs_ctrl_pY, comparison = "EC_vs_ctrl_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

##                                              pathway      pval      padj
## 1:                         ABC transporter disorders 0.7558140 0.8585859
## 2:            ABC-family proteins mediated transport 0.7558140 0.8585859
## 3:         ADP signalling through P2Y purinoceptor 1 0.4786822 0.7573016
## 4:                             ALK mutants bind TKIs 0.8953488 0.9416773
## 5: APC/C-mediated degradation of cell cycle proteins 0.6052174 0.8523120
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.4835391 0.7573016
##       log2err         ES        NES size leadingEdge
## 1: 0.05712585  0.6273292  0.8372771    1        5687
## 2: 0.05712585  0.6273292  0.8372771    1        5687
## 3: 0.07977059  0.7453416  0.9947846    1        1432
## 4: 0.04929177  0.5590062  0.7460885    1        1213
## 5: 0.06252374 -0.5988760 -0.9159559    2         983
## 6: 0.08243441 -0.7577640 -1.0132543    1         983

## Note: Row-scaling applied for this heatmap

Plot_Enrichment_Single_Pathway(dep_EC_vs_ctrl_pY, comparison = "EC_vs_ctrl_diff", 
                               pw = "Epigenetic regulation of gene expression")
data_diff_EBC_vs_ctrl_pY <- test_diff(pY_se_5d, type="manual", test = "EBC_vs_ctrl")
## Tested contrasts: EBC_vs_ctrl
dep_EBC_vs_ctrl_pY <- add_rejections_SH(data_diff_EBC_vs_ctrl_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_EBC_vs_ctrl_pY, contrast = "EBC_vs_ctrl", 
                label_size = 2, add_names = TRUE,
                additional_title = "pY"))
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Return_DEP_Hits_Plots(data = pY_noNA, dep_EBC_vs_ctrl_pY, comparison = "EBC_vs_ctrl_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

##                                              pathway      pval      padj
## 1:                         ABC transporter disorders 0.1832669 0.4050936
## 2:            ABC-family proteins mediated transport 0.1832669 0.4050936
## 3:         ADP signalling through P2Y purinoceptor 1 0.6792829 0.7588166
## 4:                             ALK mutants bind TKIs 0.2340000 0.4707322
## 5: APC/C-mediated degradation of cell cycle proteins 0.1213720 0.4050936
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.4422311 0.6117320
##       log2err         ES        NES size leadingEdge
## 1: 0.14375899  0.9192547  1.2193991    1        5687
## 2: 0.14375899  0.9192547  1.2193991    1        5687
## 3: 0.06350080  0.6583851  0.8733534    1        1432
## 4: 0.12563992 -0.8881988 -1.1764793    1        1213
## 5: 0.20895503  0.7937500  1.3474157    2        5687
## 6: 0.08553569  0.7888199  1.0463762    1         983

Not ctrl vs ctrl

data_diff_vs_ctrl_pY <- test_diff_to_all_other(pY_se_5d, control = "ctrl")
dep_vs_ctrl_pY <- add_rejections_SH(data_diff_vs_ctrl_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_vs_ctrl_pY, contrast = "not_ctrl_vs_ctrl", label_size = 2, add_names = TRUE, additional_title = "pY"))
Return_DEP_Hits_Plots(data = pY_noNA, dep_vs_ctrl_pY, comparison = "not_ctrl_vs_ctrl_diff")

EC vs E

data_diff_EC_vs_E_pY <- test_diff(pY_se_5d, type = "manual", 
                              test = c("EC_vs_E"))
## Tested contrasts: EC_vs_E
dep_EC_vs_E_pY <- add_rejections_SH(data_diff_EC_vs_E_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_EC_vs_E_pY, contrast = "EC_vs_E", label_size = 2, add_names = TRUE, additional_title = "pY"))
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Return_DEP_Hits_Plots(data = pY_noNA, dep_EC_vs_E_pY, comparison = "EC_vs_E_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

##                                              pathway       pval      padj
## 1:                         ABC transporter disorders 0.22630561 0.4248911
## 2:            ABC-family proteins mediated transport 0.22630561 0.4248911
## 3:         ADP signalling through P2Y purinoceptor 1 0.86391753 0.9158309
## 4:                             ALK mutants bind TKIs 0.96905222 0.9827157
## 5: APC/C-mediated degradation of cell cycle proteins 0.05733212 0.2883714
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.20889749 0.4248911
##       log2err         ES       NES size leadingEdge
## 1: 0.12563992  0.8881988  1.193401    1        5687
## 2: 0.12563992  0.8881988  1.193401    1        5687
## 3: 0.05378728 -0.5527950 -0.752840    1        1432
## 4: 0.04558782  0.5093168  0.684328    1        1213
## 5: 0.32177592  0.8937500  1.475311    2    983,5687
## 6: 0.13145761  0.8944099  1.201747    1         983

## Note: Row-scaling applied for this heatmap

#data_results <- get_df_long(dep)

EBC vs EC

data_diff_EC_vs_EBC_pY <- test_diff(pY_se_5d, type = "manual", 
                              test = c("EC_vs_EBC"))
## Tested contrasts: EC_vs_EBC
dep_EC_vs_EBC_pY <- add_rejections_SH(data_diff_EC_vs_EBC_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_EC_vs_EBC_pY, contrast = "EC_vs_EBC", label_size = 2, add_names = TRUE, additional_title = "pY"))
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Return_DEP_Hits_Plots(data = pY_noNA, dep_EC_vs_EBC_pY, comparison = "EC_vs_EBC_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

##                                              pathway       pval      padj
## 1:                         ABC transporter disorders 0.15637066 0.4453328
## 2:            ABC-family proteins mediated transport 0.15637066 0.4453328
## 3:         ADP signalling through P2Y purinoceptor 1 0.93436293 0.9723485
## 4:                             ALK mutants bind TKIs 0.16942149 0.4453328
## 5: APC/C-mediated degradation of cell cycle proteins 0.01316786 0.2527803
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.07335907 0.4425209
##       log2err         ES        NES size leadingEdge
## 1: 0.15419097 -0.9316770 -1.2318518    1        5687
## 2: 0.15419097 -0.9316770 -1.2318518    1        5687
## 3: 0.04716425 -0.5341615 -0.7062617    1        1432
## 4: 0.15315881  0.9130435  1.2059003    1        1213
## 5: 0.38073040 -0.9375000 -1.5204521    2    983,5687
## 6: 0.23112671 -0.9689441 -1.2811259    1         983

## Note: Row-scaling applied for this heatmap

#data_results <- get_df_long(dep)

Preps

pY_se_5d_preps <- pY_se_5d

pY_se_5d_preps$treatment <- pY_se_5d_preps$condition
pY_se_5d_preps$prep <- unlist(prep_l[paste0("Xenograft_", rownames(colData(pY_se_5d_preps)) )])
pY_se_5d_preps_comp <- pY_se_5d_preps
pY_se_5d_preps_comp$condition <- pY_se_5d_preps$prep

data_diff_prep1_vs_prep2_pY <- test_diff(pY_se_5d_preps_comp, type = "manual", 
                              test = c("prep1_vs_prep2"))
## Tested contrasts: prep1_vs_prep2
dep_prep1_vs_prep2_pY <- add_rejections_SH(data_diff_prep1_vs_prep2_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_prep1_vs_prep2_pY, contrast = "prep1_vs_prep2", label_size = 2, add_names = TRUE, additional_title = "pY"))
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Return_DEP_Hits_Plots(data = pY_noNA, dep_prep1_vs_prep2_pY, comparison = "prep1_vs_prep2_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns
##                                              pathway      pval      padj
## 1:                         ABC transporter disorders 0.7704591 0.8825486
## 2:            ABC-family proteins mediated transport 0.7704591 0.8825486
## 3:         ADP signalling through P2Y purinoceptor 1 0.1796407 0.8171742
## 4:                             ALK mutants bind TKIs 0.5848303 0.8825486
## 5: APC/C-mediated degradation of cell cycle proteins 0.6275304 0.8825486
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.8183633 0.8825486
##       log2err         ES        NES size leadingEdge
## 1: 0.05760911 -0.6335404 -0.8372185    1        5687
## 2: 0.05760911 -0.6335404 -0.8372185    1        5687
## 3: 0.14551615 -0.9192547 -1.2147876    1        1432
## 4: 0.07096095  0.7142857  0.9486414    1        1213
## 5: 0.06815134 -0.6125000 -0.9173340    2    5687,983
## 6: 0.05479395 -0.6086957 -0.8043864    1         983
## Warning in max(screen_pval05_pos[, logFcColStr]): no non-missing arguments to
## max; returning -Inf
## Warning in min(x): no non-missing arguments to min; returning Inf
## Warning in max(x): no non-missing arguments to max; returning -Inf
## Warning in min(x): no non-missing arguments to min; returning Inf
## Warning in max(x): no non-missing arguments to max; returning -Inf
## Warning in min(cs1s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs1s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in min(cs2s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs2s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in min(cs3s, na.rm = TRUE): no non-missing arguments to min; returning
## Inf
## Warning in max(cs3s, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf

## Note: Row-scaling applied for this heatmap

#data_results <- get_df_long(dep)

Runs

pY_se_5d_runs <- pY_se_5d

pY_se_5d_runs$treatment <- pY_se_5d_runs$condition
pY_se_5d_runs$run <- str_split(colnames(pY_se_5d_runs), pattern = "_", simplify = TRUE)[,4]
pY_se_5d_runs_comp <- pY_se_5d_runs
pY_se_5d_runs_comp$condition <- pY_se_5d_runs$run

data_diff_Set1_vs_Set2_pY <- test_diff(pY_se_5d_runs_comp, type = "manual", 
                              test = c("Set1_vs_Set2"))
## Tested contrasts: Set1_vs_Set2
dep_Set1_vs_Set2_pY <- add_rejections_SH(data_diff_Set1_vs_Set2_pY, alpha = 0.05, lfc = log2(1.2))
GGPlotly_Wrapper_Volcano(plot_volcano_SH(dep_Set1_vs_Set2_pY, contrast = "Set1_vs_Set2", label_size = 2, add_names = TRUE, additional_title = "pY"))
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Return_DEP_Hits_Plots(data = pY_noNA, dep_Set1_vs_Set2_pY, comparison = "Set1_vs_Set2_diff")
## 'select()' returned 1:1 mapping between keys and columns
## 'select()' returned 1:many mapping between keys and columns
## 'select()' returned 1:1 mapping between keys and columns

##                                              pathway      pval      padj
## 1:                         ABC transporter disorders 0.3984375 0.6833390
## 2:            ABC-family proteins mediated transport 0.3984375 0.6833390
## 3:         ADP signalling through P2Y purinoceptor 1 0.6152344 0.8547461
## 4:                             ALK mutants bind TKIs 0.4571429 0.7446491
## 5: APC/C-mediated degradation of cell cycle proteins 0.7801932 0.9510830
## 6:      APC/C:Cdc20 mediated degradation of Cyclin B 0.9551020 0.9724256
##       log2err         ES        NES size leadingEdge
## 1: 0.09026355 -0.8136646 -1.0774518    1        5687
## 2: 0.09026355 -0.8136646 -1.0774518    1        5687
## 3: 0.06736239 -0.7080745 -0.9376298    1        1432
## 4: 0.08504275  0.7577640  1.0208070    1        1213
## 5: 0.06613262 -0.4812500 -0.7635609    2    5687,983
## 6: 0.04870109  0.5217391  0.7028507    1         983
#data_results <- get_df_long(dep)

Session Info

sessionInfo()
## R version 4.1.3 (2022-03-10)
## Platform: x86_64-apple-darwin17.0 (64-bit)
## Running under: macOS Big Sur/Monterey 10.16
## 
## Matrix products: default
## BLAS:   /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRblas.0.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib
## 
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
## 
## attached base packages:
## [1] stats4    stats     graphics  grDevices utils     datasets  methods  
## [8] base     
## 
## other attached packages:
##  [1] forcats_0.5.2               stringr_1.4.1              
##  [3] dplyr_1.0.10                purrr_0.3.5                
##  [5] readr_2.1.3                 tidyr_1.2.1                
##  [7] tibble_3.1.8                ggplot2_3.3.6              
##  [9] tidyverse_1.3.2             mdatools_0.13.0            
## [11] SummarizedExperiment_1.24.0 GenomicRanges_1.46.1       
## [13] GenomeInfoDb_1.30.1         MatrixGenerics_1.6.0       
## [15] matrixStats_0.62.0          DEP_1.16.0                 
## [17] org.Hs.eg.db_3.14.0         AnnotationDbi_1.56.2       
## [19] IRanges_2.28.0              S4Vectors_0.32.4           
## [21] Biobase_2.54.0              BiocGenerics_0.40.0        
## [23] fgsea_1.20.0               
## 
## loaded via a namespace (and not attached):
##   [1] utf8_1.2.2             shinydashboard_0.7.2   proto_1.0.0           
##   [4] gmm_1.7                tidyselect_1.2.0       RSQLite_2.2.18        
##   [7] htmlwidgets_1.5.4      grid_4.1.3             BiocParallel_1.28.3   
##  [10] norm_1.0-10.0          munsell_0.5.0          codetools_0.2-18      
##  [13] preprocessCore_1.56.0  chron_2.3-58           DT_0.26               
##  [16] withr_2.5.0            colorspace_2.0-3       highr_0.9             
##  [19] knitr_1.40             rstudioapi_0.14        mzID_1.32.0           
##  [22] labeling_0.4.2         GenomeInfoDbData_1.2.7 pheatmap_1.0.12       
##  [25] bit64_4.0.5            farver_2.1.1           vctrs_0.5.0           
##  [28] generics_0.1.3         xfun_0.34              R6_2.5.1              
##  [31] doParallel_1.0.17      clue_0.3-62            MsCoreUtils_1.6.2     
##  [34] bitops_1.0-7           cachem_1.0.6           DelayedArray_0.20.0   
##  [37] assertthat_0.2.1       promises_1.2.0.1       scales_1.2.1          
##  [40] googlesheets4_1.0.1    gtable_0.3.1           affy_1.72.0           
##  [43] sandwich_3.0-2         rlang_1.0.6            mzR_2.28.0            
##  [46] GlobalOptions_0.1.2    lazyeval_0.2.2         gargle_1.2.1          
##  [49] impute_1.68.0          broom_1.0.1            BiocManager_1.30.19   
##  [52] yaml_2.3.6             modelr_0.1.9           crosstalk_1.2.0       
##  [55] backports_1.4.1        httpuv_1.6.6           tools_4.1.3           
##  [58] affyio_1.64.0          ellipsis_0.3.2         gplots_3.1.3          
##  [61] jquerylib_0.1.4        RColorBrewer_1.1-3     STRINGdb_2.6.5        
##  [64] MSnbase_2.20.4         gsubfn_0.7             Rcpp_1.0.9            
##  [67] hash_2.2.6.2           plyr_1.8.7             zlibbioc_1.40.0       
##  [70] RCurl_1.98-1.9         sqldf_0.4-11           GetoptLong_1.0.5      
##  [73] zoo_1.8-11             haven_2.5.1            ggrepel_0.9.1         
##  [76] cluster_2.1.4          fs_1.5.2               magrittr_2.0.3        
##  [79] data.table_1.14.4      circlize_0.4.15        reprex_2.0.2          
##  [82] reactome.db_1.77.0     googledrive_2.0.0      pcaMethods_1.86.0     
##  [85] mvtnorm_1.1-3          ProtGenerics_1.26.0    hms_1.1.2             
##  [88] mime_0.12              evaluate_0.17          xtable_1.8-4          
##  [91] XML_3.99-0.12          readxl_1.4.1           gridExtra_2.3         
##  [94] shape_1.4.6            compiler_4.1.3         KernSmooth_2.23-20    
##  [97] ncdf4_1.19             crayon_1.5.2           htmltools_0.5.3       
## [100] later_1.3.0            tzdb_0.3.0             lubridate_1.8.0       
## [103] DBI_1.1.3              dbplyr_2.2.1           ComplexHeatmap_2.10.0 
## [106] MASS_7.3-58.1          tmvtnorm_1.5           Matrix_1.5-1          
## [109] cli_3.4.1              vsn_3.62.0             imputeLCMD_2.1        
## [112] parallel_4.1.3         igraph_1.3.5           pkgconfig_2.0.3       
## [115] plotly_4.10.0          MALDIquant_1.21        xml2_1.3.3            
## [118] foreach_1.5.2          bslib_0.4.0            XVector_0.34.0        
## [121] rvest_1.0.3            digest_0.6.30          Biostrings_2.62.0     
## [124] rmarkdown_2.17         cellranger_1.1.0       fastmatch_1.1-3       
## [127] shiny_1.7.3            gtools_3.9.3           rjson_0.2.21          
## [130] lifecycle_1.0.3        jsonlite_1.8.3         viridisLite_0.4.1     
## [133] limma_3.50.3           fansi_1.0.3            pillar_1.8.1          
## [136] lattice_0.20-45        KEGGREST_1.34.0        fastmap_1.1.0         
## [139] httr_1.4.4             plotrix_3.8-2          glue_1.6.2            
## [142] fdrtool_1.2.17         png_0.1-7              iterators_1.0.14      
## [145] bit_4.0.4              stringi_1.7.8          sass_0.4.2            
## [148] blob_1.2.3             caTools_1.18.2         memoise_2.0.1
knitr::knit_exit()